<?php
# timezone
date_default_timezone_set("PRC");

# time format
date("Y-m-d H:i:s",time());
date("Y-m-d H:i:s","1635839505");

# date modify
date("Y-m-d H:i:s",strtotime("+1 day",time()));
date('Y-m-d H:i:s',strtotime('+1 hour',time()));
date('Y-m-d H:i:s',strtotime('+1 minutes',time()));
date('Y-m-d H:i:s',strtotime('+1 seconds',time()));

# string to date
date('Y-m-d H:i:s',strtotime('2021-01-01 00:00:00'));

# millisecond
function getMillisecond() { 
    list($s1, $s2) = explode(' ', microtime()); 
    return (float)sprintf('%.0f', (floatval($s1) + floatval($s2)) * 1000); 
}
